﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;

namespace MvcEnrollment.Helpers
{
    public class RebillResponse
    {
        private string m_Result;
        private string m_ErrorSeverity;
        private string m_ErrorDetails;

        public RebillResponse(string xmlString)
        {
            XmlDocument xmlDoc = new XmlDocument();

            try
            {
                xmlDoc.LoadXml(xmlString);
                if (xmlDoc.HasChildNodes)
                {
                    Result = xmlDoc.SelectSingleNode("/ResponseDetails/Result").InnerText;
                    ErrorDetails = xmlDoc.SelectSingleNode("/ResponseDetails/ErrorDetails").InnerText;
                    ErrorSeverity = xmlDoc.SelectSingleNode("/ResponseDetails/ErrorSeverity").InnerText;
                }
            }
            catch
            {

            }

        }

        public string Result { get { return m_Result; } set { m_Result = value; } }
        public string ErrorSeverity { get { return m_ErrorSeverity; } set { m_ErrorSeverity = value; } }
        public string ErrorDetails { get { return m_ErrorDetails; } set { m_ErrorDetails = value; } }
    }
}